import { ApiReturn } from '@/types/global';
import { get, post } from '@/utils/request';
import { ListReq, ListResp, CreateReq, CreateResp, DeleteReq, GetReq, GetResp, UpdateReq, UpdateResp } from '../vms';

class ConfigMapService {
  static list = (params: ListReq): ApiReturn<ListResp> =>
    get('/v1/cm/list', params);

  static create = (data: CreateReq): ApiReturn<CreateResp> =>
    post('/v1/cm/create', data);

  static delete = (params: DeleteReq): ApiReturn<{}> =>
    get('/v1/cm/delete', params);

  static get = (params: GetReq): ApiReturn<GetResp> =>
    get('/v1/cm/get', params);

  static update = (data: UpdateReq): ApiReturn<UpdateResp> =>
    post('/v1/cm/update', data);
}

export { ConfigMapService };
export default ConfigMapService;
